/*************************************************************************
	> File Name: 005.inttypes头文件中的类型.c
	> Author: Maureen 
	> Mail: Maureen@qq.com 
	> Created Time: 五  8/20 22:27:38 2021
 ************************************************************************/

#include <stdio.h>
#include <inttypes.h>

int main() {
    //int32_t定义的变量，无论是在32位还是64位操作系统中，都占32位，即4个字节
    //若不使用int32_t类型，则在32位系统中，int占2个字节，最大值为65535，无法表示70000这个数
    int32_t a = 70000; 
    //PRIx是一个字符串宏
    printf("%" PRId32 "\n", a);

    
    //inttypes中的最值
    printf("INT8_MIN = " "%" PRId8 ", INT8_MAX = " "%" PRId8 "\n", INT8_MIN, INT8_MAX);
    printf("INT16_MIN = " "%" PRId16 ", INT16_MAX = " "%" PRId16 "\n", INT16_MIN, INT16_MAX);
    printf("INT32_MIN = " "%" PRId32 ", INT32_MAX = " "%" PRId32 "\n", INT32_MIN, INT32_MAX);
    printf("INT64_MIN = " "%" PRId64 ", INT64_MAX = " "%" PRId64 "\n", INT64_MIN, INT64_MAX);

    return 0;
}
/*运行测试结果：
70000
INT8_MIN = -128, INT8_MAX = 127
INT16_MIN = -32768, INT16_MAX = 32767
INT32_MIN = -2147483648, INT32_MAX = 2147483647
INT64_MIN = -9223372036854775808, INT64_MAX = 9223372036854775807
 */

